//
//  SearchHistoryTableViewCell.swift
//  OnceNectar
//
//  Created by 法正磊 on 2018/2/5.
//  Copyright © 2018年 com.inwhoop. All rights reserved.
//

import UIKit

protocol SearchHistoryTableViewCellDelegate: NSObjectProtocol {
    func searchHistoryDedeleteButtonTap(_ cell: SearchHistoryTableViewCell)
}

class SearchHistoryTableViewCell: UITableViewCell {
    @IBOutlet weak var dataLabel: UILabel!
    weak var delegate: SearchHistoryTableViewCellDelegate?
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    @IBAction func deleteButtonTap(_ sender: UIButton) {
        self.delegate?.searchHistoryDedeleteButtonTap(self)
    }
    func bindData(model:SearchKeyModel) -> Void {
        if let name = model.name {
            dataLabel.text = name
        }
    }
}
